package webapi

import "net/http"

//ServiceBase WebApi继承这个类。注册控制台
type ServiceBase struct {
	path string
	mux  *http.ServeMux
}

//Regist 注册
func (_this *ServiceBase) Regist(mux *http.ServeMux) {
	_this.path = "/Service/"
	_this.mux = mux
}

//HandleRegist 注册事件响应方法
func (_this *ServiceBase) HandleRegist(pattern string, handler func(http.ResponseWriter, *http.Request)) {
	_this.mux.HandleFunc(_this.path+"/"+pattern+"/", handler)
}
